package com.zjl.spring.exception;

import com.zjl.spring.enums.BaseCode;
import com.zjl.spring.enums.BaseCodeI;

/**
 * 业务异常抽象类
 *
 * @Auther: zhuangjl
 * @Date: 2021/11/11 15:43
 */
public abstract class BaseBizException extends BaseException {

    private final long serialVersionUID = 1L;
    private final BaseCodeI DEFAULT_RESPONSE_CODE;

    public BaseBizException() {
        this.DEFAULT_RESPONSE_CODE = BaseCode.BUSINESS_ERROR;
        this.setBaseCode(BaseCode.BUSINESS_ERROR);
    }

    public BaseBizException(String errMessage) {
        super(errMessage);
        this.DEFAULT_RESPONSE_CODE = BaseCode.BUSINESS_ERROR;
        this.setBaseCode(this.DEFAULT_RESPONSE_CODE);
    }

    public BaseBizException(String errMessage, Throwable e) {
        super(errMessage, e);
        this.DEFAULT_RESPONSE_CODE = BaseCode.BUSINESS_ERROR;
        this.setBaseCode(this.DEFAULT_RESPONSE_CODE);
    }
}
